package Coding.file;
import java.io.File;
import java.io.IOException;

public class CreateNewFileDemo {
    public static void main(String[] args) throws IOException {
        //在当前目录下创建文件 创建新文件

        File file = new File("./DirectoryD/text.txt");
        if(file.exists()){
            System.out.println("已经存在了");
        }else {
            boolean newFile = file.createNewFile();
            System.out.println("文件创建成功");
        }


    }
}
